package GUI;

import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;

public class StatusBar extends JPanel{

	
	private JLabel status = new JLabel();
	private JProgressBar progressbar = new JProgressBar();
	
	public StatusBar(){
		init();
	}
	
	
	private void init(){
		setLayout(new BorderLayout());
		add(status,BorderLayout.WEST);
		add(progressbar, BorderLayout.EAST);
	}
	
	
	public void setStatus(String txt){
		status.setText(txt);
		progressbar.setIndeterminate(true);
	}
	
	public void setOnlyStatus(String txt){
		status.setText(txt);
	}
	
	public void setStatusBar(int stat){
		progressbar.setStringPainted(true);
		progressbar.setString(stat + " %");
		progressbar.setValue(stat);
	}
	
	public void clear(){
		progressbar.setIndeterminate(false);
		status.setText("");
	}
	
}	
